package com.gitee.kamismile.stone.basic.data.domain.sysdic.service;

import com.gitee.kamismile.stone.basic.data.application.rep.DictionaryDefineRep;
import com.gitee.kamismile.stone.basic.data.application.req.query.dic.SysDictionaryDefineQuery;
import com.gitee.kamismile.stone.basic.data.domain.sysdic.repository.entity.SysDictionary;
import com.gitee.kamismile.stone.basic.data.domain.sysdic.repository.entity.SysDictionaryDefine;
import org.springframework.data.domain.Page;
import org.springframework.data.relational.core.query.Criteria;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public interface ISysDictionaryDomainService {

    /**
     * 根据别名查询
     *
     * @param alias
     * @param nTenantId
     * @return
     */
    public Mono<SysDictionary> findDicDefineByAlias(String alias, Integer nTenantId);


    public Mono<SysDictionary> saveOrUpdate(SysDictionary sysDictionary);

    public Mono<Page<SysDictionary>> findAllBy(int page, int size,
                                             Criteria criteria);


    public Mono<Page<SysDictionaryDefine>> findDicDefinePageByDicId(int page, int size,
                                                                    Criteria criteria);

    public Flux<DictionaryDefineRep> findDicDefineByAlias(SysDictionaryDefineQuery query);

    public Mono<SysDictionaryDefine> saveOrUpdate(SysDictionaryDefine sysDictionaryDefine);

    Mono<Void> deleteDicById(Integer nSysDictionaryId,Integer nTenantId);


    public Mono<Void> deleteDicDefineById(Long nSysDictionaryDefineId, Integer nTenantId) ;

    public Mono<SysDictionary> findAndCheckSysDicById(Integer nSysDictionaryId, Integer nTenantId);

    public Mono<SysDictionaryDefine> findAndCheckSysDicDefineById(Long nSysDictionaryDefineId, Integer nTenantId);

}
